package com.rd.student.ruanjian.class4.lichunquan.L_2023_7_10;

import java.util.LinkedList;

public class Demo02 {
    public static void main(String[] args) {
        //链表LinkedList
        /*
        前置 prev
        数据 date
        后置 next
        */

        LinkedList_01 linkedList_01 = new LinkedList_01();
        linkedList_01.test01();
    }
}
class LinkedList_01{
    public void test01(){
        LinkedList linkedList = new LinkedList();
        student s1 = new student("李春泉","软四","软件");
        student s2 = new student("周子贺","软四","软件");
        student s3 = new student("高艺铭","软四","软件");
        student s4 = new student("王星凯","软四","软件");
        student s7 = new student("柏云耀","软四","软件");
        student s5 = new student("杜航","软五","软件");
        student s6 = new student("张睿","软四","软件");
        linkedList.add(s1);
        linkedList.add(s2);
        linkedList.add(s3);
        linkedList.add(s4);
        linkedList.add(s7);
        linkedList.add(s6);
        linkedList.add(s5);

        for (int i = 0; i < linkedList.size(); i++) {
            System.out.println(linkedList.get(i));
        }

    }
}
class student{
    String name ;
    String Class ;
    String zhuanye ;

    @Override
    public String toString() {
        return
                "姓名：'" + name + '\'' +
                ", 班级：'" + Class + '\'' +
                ", 专业：'" + zhuanye + '\''
                ;
    }

    public student(String name, String Class, String zhuanye) {
        this.name = name;
        this.Class = Class;
        this.zhuanye = zhuanye;
    }
}
